import request from '@/utils/request'

// 查询菜品列表
export function listFood(query) {
  return request({
    url: '/scancode/food/list',
    method: 'get',
    params: query
  })
}

// 查询菜品详细
export function getFood(id) {
  return request({
    url: '/scancode/food/getInfo/' + id,
    method: 'get'
  })
}

// 新增菜品
export function addFood(data) {
  return request({
    url: '/scancode/food/add',
    method: 'post',
    data: data
  })
}

// 修改菜品
export function updateFood(data) {
  return request({
    url: '/scancode/food/edit',
    method: 'post',
    data: data
  })
}

// 删除菜品
export function delFood(id) {
  return request({
    url: '/scancode/food/del/' + id,
    method: 'post'
  })
}

// 导出菜品
export function exportFood(query) {
  return request({
    url: '/scancode/food/export',
    method: 'get',
    params: query
  })
}
// 查询菜品分类列表
export function listClassify(query) {
  return request({
    url: '/scancode/classify/list',
    method: 'get',
    params: query
  })
}
//根据菜品id查询菜品规格
export function foodIdSpec(orderId) {
  return request({
    url: '/scancode/specifications/findFsByFodId?foodId=' + orderId,
    method: 'get'
  })
}
//添加菜品规格
export function addFoodSpec(query) {
  return request({
    url: '/scancode/specifications/add',
    method: 'post',
    data: query
  })
}
//删除菜品规格
export function delFoodSpec(id) {
  return request({
    url: '/scancode/specifications/del?ids=' + id,
    method: 'post'
  })
}
//通过foodId获取菜品规格
export function getFoodIdSpec(foodId) {
  return request({
    url: '/scancode/specifications/findFsByFodId?foodId=' + foodId,
    method: 'get'
  })
}
//修改菜品规格
export function editFoodIdSpec(query) {
  return request({
    url: '/scancode/specifications/edit',
    method: 'post',
    data: query
  })
}
